home *** CD-ROM | disk | FTP | other *** search
- /* BullsEyeFindCursor.c -
- by: David Phillip Oster
- email: oster@netcom.com
- date: 5/20/94
- distribution: This file is hereby placed in the public domain.
- notes:
- An fkey to make it easier to spot the mouse cursor.
- Install this as a Code resource, FKEY 9, in your System file.
- Written for a friend who loses her cursor on the Mac's screen.
- This program doesn't need MacTraps.
- */
-
- /* main
- */
- pascal void main(void){
- WindowPtr win; /* we'llbe drawing here, It'll be the window manager port */
- WindowPtr savePort; /* save and restore the port we came in on */
- short saveMode; /* save and restore the window manager port's drawing mode */
- short i; /* loop counter, number of concentric rings */
- short j; /* loop counter, number of repeats. even number erases */
- long dontCare; /* delay wants to tell us something we don't care about */
- Rect r; /* bounds of our circle */
- Point p; /* the mouse point */
-
- GetPort(&savePort);
- GetWMgrPort(&win);
- if(nil == win){
- return;
- }
- SetPort(win);
- GetMouse(&p);
- saveMode = win->pnMode;
- PenMode(patXor);
- for(j = 0 ; j < 4; j++){
- botRight(r) = topLeft(r) = p;
- InsetRect(&r, -1, -1);
- for(i = 0 ; i < 24; i++){
- InsetRect(&r, -4, -4);
- PaintOval(&r);
- Delay(1, &dontCare);
- }
- }
- PenMode(saveMode);
- SetPort(savePort);
- }